<?php
//include("../include/function.php");
dbconnect();
session_start();
?>
<?php
if($_SESSION["loggedin"]==true && $_SESSION["role"]==admin)
{
if(isset($_SESSION[msg]))
{
echo $_SESSION[msg];
unset($_SESSION[msg]);
}
?>

<?php 
if(isset($_POST['clientmanage']))
{
$clientname = $_POST['clientname'];
$insertvalue = array();
$insertvalue[clientname]=$clientname;
$insertq = insertquery("client",$insertvalue);
/* $clientinsert = "INSERT into client (clientname) values('$clientname')";
$client = mysql_query($clientinsert); */
header("Location: index.php?management=client");
}
?>

<table border="1" cellspacing="0">
<tr><td>Client Name</td><td></td>
<td><a href="javascript:void(0)" id="add">ADD</a></td>
</tr>
<?php
//while($row = mysql_fetch_array($selectquery))
$client = selectquery("client");
foreach($client as $key=>$row)

{?>
<tr><td>
<?php
echo $row['clientname'];
?>
</td>
<td><a href="index.php?management=client&&task=edit&&id=<?php echo $row[clientid]; ?>">EDIT</a></td>
<td><a href="index.php?management=client&&task=delete&&id=<?php echo $row[clientid]; ?>">DELETE</a></td>
</tr>
<?php
}

?>
</table>
<?php 

?>
<?php

}
else
{
header("Location: login.php");
}

exit;
?>